/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bankaccount;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author INEZ
 */
public class ConnectionBuilder {
    public static Connection getConnection(){
        String url = "jdbc:derby://localhost:1527/BankAccount";
        Connection con = null;
        try {
            Class.forName("org.apache.derby.jdbc.ClientDriver");
            con = DriverManager.getConnection(url, "app","app");
        } catch (SQLException | ClassNotFoundException ex) {
            System.out.println(ex.getMessage());
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }
        return con;
       
    }
}
